package com.ccreservoirs.controller;

import java.util.concurrent.TimeUnit;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ccreservoirs.service.HelloService;

@RestController
public class HelloController {

	@Resource(name = "stringRedisTemplate")
	RedisTemplate template;

	@Autowired
	HelloService iHelloService;

	@GetMapping("/")
	public String index() {
		iHelloService.getName("123");
		iHelloService.getIds();

		template.opsForValue().set("12324142", "24123", 10000, TimeUnit.MILLISECONDS);

		return "hello";
	}

	@GetMapping("/1")
	public String index2() {
		iHelloService.removeName();
		return "hello2";
	}

}
